const app = getApp();
const regeneratorRuntime = global.regeneratorRuntime = require('../libs/regenerator');
const co = require("../libs/co");
const http = require('../libs/httpRequest');
const appConfig = require('../appConfig');

var SlideshowService = function () {

    var _getSlideshows = function *(categoryId) {

        var ret = yield http.request({
            url: `${appConfig.api.baseUrl}/data/slideShow`,
            data: {categoryId: categoryId},
            method: 'POST',
            success: (res) => {
                console.log(res.data);
            },
            fail: (err) => {
                console.log(err);
            }
        });
        return ret;
    }
    return {
        getSlideshows: _getSlideshows
    }
}();

module.exports = SlideshowService;
